using System;
using System.ComponentModel;
using System.Data.Services.Client;
using System.Diagnostics;
using OrbitOne.CRMLyncInfoDashboard.CRM.OrganizationData;

using EntityReference = OrbitOne.CRMLyncInfoDashboard.CRM.OrganizationData.EntityReference;
using Money = OrbitOne.CRMLyncInfoDashboard.CRM.OrganizationData.Money;
using OptionSetValue = OrbitOne.CRMLyncInfoDashboard.CRM.OrganizationData.OptionSetValue;

namespace OrbitOne.CRMLyncInfoDashboard.CRM.OData
{
    [DebuggerDisplay("Account: {Id} {FullName}")]
    public class ContactModel : IEntityModel
    {
        private readonly Contact m_contact;

        public EntityModelTypes ModelType { get { return EntityModelTypes.ContactModel; } }

        public ContactModel(Contact contact)
        {
            m_contact = contact;
        }

        public ContactModel()
            : this(new Contact())
        {
        }

        public Guid Id
        {
            get { return m_contact.ContactId; }
        }

        public string DisplayText
        {
            get { return FullName; }
        }

        public int SequenceNumber
        {
            get { return 2; }
        }

        public EntitytMetadataModel Metadata { get; set; }

        public OptionSetValue PreferredAppointmentTimeCode
        {
            get { return m_contact.PreferredAppointmentTimeCode; }
            set { m_contact.PreferredAppointmentTimeCode = value; }
        }

        public string EMailAddress3
        {
            get { return m_contact.EMailAddress3; }
            set { m_contact.EMailAddress3 = value; }
        }

        public EntityReference PreferredServiceId
        {
            get { return m_contact.PreferredServiceId; }
            set { m_contact.PreferredServiceId = value; }
        }

        public Money AnnualIncome
        {
            get { return m_contact.AnnualIncome; }
            set { m_contact.AnnualIncome = value; }
        }

        public string Fax
        {
            get { return m_contact.Fax; }
            set { m_contact.Fax = value; }
        }

        public double? Address1_Latitude
        {
            get { return m_contact.Address1_Latitude; }
            set { m_contact.Address1_Latitude = value; }
        }

        public string Telephone3
        {
            get { return m_contact.Telephone3; }
            set { m_contact.Telephone3 = value; }
        }

        public OptionSetValue PreferredAppointmentDayCode
        {
            get { return m_contact.PreferredAppointmentDayCode; }
            set { m_contact.PreferredAppointmentDayCode = value; }
        }

        public long? VersionNumber
        {
            get { return m_contact.VersionNumber; }
            set { m_contact.VersionNumber = value; }
        }

        public string Address2_StateOrProvince
        {
            get { return m_contact.Address2_StateOrProvince; }
            set { m_contact.Address2_StateOrProvince = value; }
        }

        public EntityReference CreatedBy
        {
            get { return m_contact.CreatedBy; }
            set { m_contact.CreatedBy = value; }
        }

        public string Address2_Line1
        {
            get { return m_contact.Address2_Line1; }
            set { m_contact.Address2_Line1 = value; }
        }

        public DateTime? LastUsedInCampaign
        {
            get { return m_contact.LastUsedInCampaign; }
            set { m_contact.LastUsedInCampaign = value; }
        }

        public string Pager
        {
            get { return m_contact.Pager; }
            set { m_contact.Pager = value; }
        }

        public string EmployeeId
        {
            get { return m_contact.EmployeeId; }
            set { m_contact.EmployeeId = value; }
        }

        public OptionSetValue TerritoryCode
        {
            get { return m_contact.TerritoryCode; }
            set { m_contact.TerritoryCode = value; }
        }

        public string ManagerName
        {
            get { return m_contact.ManagerName; }
            set { m_contact.ManagerName = value; }
        }

        public DateTime? BirthDate
        {
            get { return m_contact.BirthDate; }
            set { m_contact.BirthDate = value; }
        }

        public string YomiFullName
        {
            get { return m_contact.YomiFullName; }
            set { m_contact.YomiFullName = value; }
        }

        public OptionSetValue Address2_ShippingMethodCode
        {
            get { return m_contact.Address2_ShippingMethodCode; }
            set { m_contact.Address2_ShippingMethodCode = value; }
        }

        public string Address2_Telephone1
        {
            get { return m_contact.Address2_Telephone1; }
            set { m_contact.Address2_Telephone1 = value; }
        }

        public string Address2_Telephone2
        {
            get { return m_contact.Address2_Telephone2; }
            set { m_contact.Address2_Telephone2 = value; }
        }

        public string Address2_PrimaryContactName
        {
            get { return m_contact.Address2_PrimaryContactName; }
            set { m_contact.Address2_PrimaryContactName = value; }
        }

        public double? Address2_Latitude
        {
            get { return m_contact.Address2_Latitude; }
            set { m_contact.Address2_Latitude = value; }
        }

        public Money AnnualIncome_Base
        {
            get { return m_contact.AnnualIncome_Base; }
            set { m_contact.AnnualIncome_Base = value; }
        }

        public int? TimeZoneRuleVersionNumber
        {
            get { return m_contact.TimeZoneRuleVersionNumber; }
            set { m_contact.TimeZoneRuleVersionNumber = value; }
        }

        public OptionSetValue LeadSourceCode
        {
            get { return m_contact.LeadSourceCode; }
            set { m_contact.LeadSourceCode = value; }
        }

        public int? UTCConversionTimeZoneCode
        {
            get { return m_contact.UTCConversionTimeZoneCode; }
            set { m_contact.UTCConversionTimeZoneCode = value; }
        }

        public EntityReference OwningUser
        {
            get { return m_contact.OwningUser; }
            set { m_contact.OwningUser = value; }
        }

        public int? Address1_UTCOffset
        {
            get { return m_contact.Address1_UTCOffset; }
            set { m_contact.Address1_UTCOffset = value; }
        }

        public EntityReference MasterId
        {
            get { return m_contact.MasterId; }
            set { m_contact.MasterId = value; }
        }

        public EntityReference CreatedOnBehalfBy
        {
            get { return m_contact.CreatedOnBehalfBy; }
            set { m_contact.CreatedOnBehalfBy = value; }
        }

        public string Address1_City
        {
            get { return m_contact.Address1_City; }
            set { m_contact.Address1_City = value; }
        }

        public Guid? SubscriptionId
        {
            get { return m_contact.SubscriptionId; }
            set { m_contact.SubscriptionId = value; }
        }

        public int? NumberOfChildren
        {
            get { return m_contact.NumberOfChildren; }
            set { m_contact.NumberOfChildren = value; }
        }

        public OptionSetValue Address1_FreightTermsCode
        {
            get { return m_contact.Address1_FreightTermsCode; }
            set { m_contact.Address1_FreightTermsCode = value; }
        }

        public OptionSetValue CustomerTypeCode
        {
            get { return m_contact.CustomerTypeCode; }
            set { m_contact.CustomerTypeCode = value; }
        }

        public string ManagerPhone
        {
            get { return m_contact.ManagerPhone; }
            set { m_contact.ManagerPhone = value; }
        }

        public Money Aging90_Base
        {
            get { return m_contact.Aging90_Base; }
            set { m_contact.Aging90_Base = value; }
        }

        public double? Address1_Longitude
        {
            get { return m_contact.Address1_Longitude; }
            set { m_contact.Address1_Longitude = value; }
        }

        public OptionSetValue Address1_AddressTypeCode
        {
            get { return m_contact.Address1_AddressTypeCode; }
            set { m_contact.Address1_AddressTypeCode = value; }
        }

        public Money CreditLimit_Base
        {
            get { return m_contact.CreditLimit_Base; }
            set { m_contact.CreditLimit_Base = value; }
        }

        public OptionSetValue StatusCode
        {
            get { return m_contact.StatusCode; }
            set { m_contact.StatusCode = value; }
        }

        public OptionSetValue FamilyStatusCode
        {
            get { return m_contact.FamilyStatusCode; }
            set { m_contact.FamilyStatusCode = value; }
        }

        public string Department
        {
            get { return m_contact.Department; }
            set { m_contact.Department = value; }
        }

        public EntityReference OwningTeam
        {
            get { return m_contact.OwningTeam; }
            set { m_contact.OwningTeam = value; }
        }

        public Money Aging60
        {
            get { return m_contact.Aging60; }
            set { m_contact.Aging60 = value; }
        }

        public OptionSetValue StateCode
        {
            get { return m_contact.StateCode; }
            set { m_contact.StateCode = value; }
        }

        public OptionSetValue Address2_FreightTermsCode
        {
            get { return m_contact.Address2_FreightTermsCode; }
            set { m_contact.Address2_FreightTermsCode = value; }
        }

        public string Address1_Name
        {
            get { return m_contact.Address1_Name; }
            set { m_contact.Address1_Name = value; }
        }

        public string YomiMiddleName
        {
            get { return m_contact.YomiMiddleName; }
            set { m_contact.YomiMiddleName = value; }
        }

        public EntityReference ModifiedOnBehalfBy
        {
            get { return m_contact.ModifiedOnBehalfBy; }
            set { m_contact.ModifiedOnBehalfBy = value; }
        }

        public string Description
        {
            get { return m_contact.Description; }
            set { m_contact.Description = value; }
        }

        public OptionSetValue EducationCode
        {
            get { return m_contact.EducationCode; }
            set { m_contact.EducationCode = value; }
        }

        public string Address1_Telephone3
        {
            get { return m_contact.Address1_Telephone3; }
            set { m_contact.Address1_Telephone3 = value; }
        }

        public EntityReference OwnerId
        {
            get { return m_contact.OwnerId; }
            set { m_contact.OwnerId = value; }
        }

        public OptionSetValue Address2_AddressTypeCode
        {
            get { return m_contact.Address2_AddressTypeCode; }
            set { m_contact.Address2_AddressTypeCode = value; }
        }

        public EntityReference ParentCustomerId
        {
            get { return m_contact.ParentCustomerId; }
            set { m_contact.ParentCustomerId = value; }
        }

        public Money Aging60_Base
        {
            get { return m_contact.Aging60_Base; }
            set { m_contact.Aging60_Base = value; }
        }

        public string Address1_County
        {
            get { return m_contact.Address1_County; }
            set { m_contact.Address1_County = value; }
        }

        public EntityReference OwningBusinessUnit
        {
            get { return m_contact.OwningBusinessUnit; }
            set { m_contact.OwningBusinessUnit = value; }
        }

        public string JobTitle
        {
            get { return m_contact.JobTitle; }
            set { m_contact.JobTitle = value; }
        }

        public string Address1_Telephone2
        {
            get { return m_contact.Address1_Telephone2; }
            set { m_contact.Address1_Telephone2 = value; }
        }

        public string Address1_Fax
        {
            get { return m_contact.Address1_Fax; }
            set { m_contact.Address1_Fax = value; }
        }

        public string Address2_PostOfficeBox
        {
            get { return m_contact.Address2_PostOfficeBox; }
            set { m_contact.Address2_PostOfficeBox = value; }
        }

        public string Address1_Line2
        {
            get { return m_contact.Address1_Line2; }
            set { m_contact.Address1_Line2 = value; }
        }

        public bool? IsBackofficeCustomer
        {
            get { return m_contact.IsBackofficeCustomer; }
            set { m_contact.IsBackofficeCustomer = value; }
        }

        public OptionSetValue PaymentTermsCode
        {
            get { return m_contact.PaymentTermsCode; }
            set { m_contact.PaymentTermsCode = value; }
        }

        public int? Address2_UTCOffset
        {
            get { return m_contact.Address2_UTCOffset; }
            set { m_contact.Address2_UTCOffset = value; }
        }

        public string YomiLastName
        {
            get { return m_contact.YomiLastName; }
            set { m_contact.YomiLastName = value; }
        }

        public string EMailAddress2
        {
            get { return m_contact.EMailAddress2; }
            set { m_contact.EMailAddress2 = value; }
        }

        public string Address2_Line3
        {
            get { return m_contact.Address2_Line3; }
            set { m_contact.Address2_Line3 = value; }
        }

        public string MobilePhone
        {
            get { return m_contact.MobilePhone; }
            set { m_contact.MobilePhone = value; }
        }

        public Guid? Address2_AddressId
        {
            get { return m_contact.Address2_AddressId; }
            set { m_contact.Address2_AddressId = value; }
        }

        public DateTime? OverriddenCreatedOn
        {
            get { return m_contact.OverriddenCreatedOn; }
            set { m_contact.OverriddenCreatedOn = value; }
        }

        public string Address1_Telephone1
        {
            get { return m_contact.Address1_Telephone1; }
            set { m_contact.Address1_Telephone1 = value; }
        }

        public string ChildrensNames
        {
            get { return m_contact.ChildrensNames; }
            set { m_contact.ChildrensNames = value; }
        }

        public EntityReference OriginatingLeadId
        {
            get { return m_contact.OriginatingLeadId; }
            set { m_contact.OriginatingLeadId = value; }
        }

        public OptionSetValue PreferredContactMethodCode
        {
            get { return m_contact.PreferredContactMethodCode; }
            set { m_contact.PreferredContactMethodCode = value; }
        }

        public Money Aging90
        {
            get { return m_contact.Aging90; }
            set { m_contact.Aging90 = value; }
        }

        public bool? DoNotPostalMail
        {
            get { return m_contact.DoNotPostalMail; }
            set { m_contact.DoNotPostalMail = value; }
        }

        public string EMailAddress1
        {
            get { return m_contact.EMailAddress1; }
            set { m_contact.EMailAddress1 = value; }
        }

        public bool? DoNotBulkEMail
        {
            get { return m_contact.DoNotBulkEMail; }
            set { m_contact.DoNotBulkEMail = value; }
        }

        public OptionSetValue CustomerSizeCode
        {
            get { return m_contact.CustomerSizeCode; }
            set { m_contact.CustomerSizeCode = value; }
        }

        public string Address1_StateOrProvince
        {
            get { return m_contact.Address1_StateOrProvince; }
            set { m_contact.Address1_StateOrProvince = value; }
        }

        public string FullName
        {
            get { return m_contact.FullName; }
            set { m_contact.FullName = value; }
        }

        public string Address2_Line2
        {
            get { return m_contact.Address2_Line2; }
            set { m_contact.Address2_Line2 = value; }
        }

        public EntityReference TransactionCurrencyId
        {
            get { return m_contact.TransactionCurrencyId; }
            set { m_contact.TransactionCurrencyId = value; }
        }

        public bool? Merged
        {
            get { return m_contact.Merged; }
            set { m_contact.Merged = value; }
        }

        public string orb_lyncsearchfield
        {
            get { return m_contact.orb_lyncsearchfield; }
            set { m_contact.orb_lyncsearchfield = value; }
        }

        public OptionSetValue Address1_ShippingMethodCode
        {
            get { return m_contact.Address1_ShippingMethodCode; }
            set { m_contact.Address1_ShippingMethodCode = value; }
        }

        public string FtpSiteUrl
        {
            get { return m_contact.FtpSiteUrl; }
            set { m_contact.FtpSiteUrl = value; }
        }

        public EntityReference PreferredSystemUserId
        {
            get { return m_contact.PreferredSystemUserId; }
            set { m_contact.PreferredSystemUserId = value; }
        }

        public Guid? Address1_AddressId
        {
            get { return m_contact.Address1_AddressId; }
            set { m_contact.Address1_AddressId = value; }
        }

        public string NickName
        {
            get { return m_contact.NickName; }
            set { m_contact.NickName = value; }
        }

        public string Address1_PostOfficeBox
        {
            get { return m_contact.Address1_PostOfficeBox; }
            set { m_contact.Address1_PostOfficeBox = value; }
        }

        public EntityReference PreferredEquipmentId
        {
            get { return m_contact.PreferredEquipmentId; }
            set { m_contact.PreferredEquipmentId = value; }
        }

        public int? ImportSequenceNumber
        {
            get { return m_contact.ImportSequenceNumber; }
            set { m_contact.ImportSequenceNumber = value; }
        }

        public string AssistantName
        {
            get { return m_contact.AssistantName; }
            set { m_contact.AssistantName = value; }
        }

        public string Address2_Country
        {
            get { return m_contact.Address2_Country; }
            set { m_contact.Address2_Country = value; }
        }

        public DateTime? ModifiedOn
        {
            get { return m_contact.ModifiedOn; }
            set { m_contact.ModifiedOn = value; }
        }

        public bool? DoNotBulkPostalMail
        {
            get { return m_contact.DoNotBulkPostalMail; }
            set { m_contact.DoNotBulkPostalMail = value; }
        }

        public string ExternalUserIdentifier
        {
            get { return m_contact.ExternalUserIdentifier; }
            set { m_contact.ExternalUserIdentifier = value; }
        }

        public OptionSetValue GenderCode
        {
            get { return m_contact.GenderCode; }
            set { m_contact.GenderCode = value; }
        }

        public string Address2_Name
        {
            get { return m_contact.Address2_Name; }
            set { m_contact.Address2_Name = value; }
        }

        public bool? DoNotFax
        {
            get { return m_contact.DoNotFax; }
            set { m_contact.DoNotFax = value; }
        }

        public bool? ParticipatesInWorkflow
        {
            get { return m_contact.ParticipatesInWorkflow; }
            set { m_contact.ParticipatesInWorkflow = value; }
        }

        public OptionSetValue AccountRoleCode
        {
            get { return m_contact.AccountRoleCode; }
            set { m_contact.AccountRoleCode = value; }
        }

        public string Address2_Telephone3
        {
            get { return m_contact.Address2_Telephone3; }
            set { m_contact.Address2_Telephone3 = value; }
        }

        public string SpousesName
        {
            get { return m_contact.SpousesName; }
            set { m_contact.SpousesName = value; }
        }

        public bool? DoNotPhone
        {
            get { return m_contact.DoNotPhone; }
            set { m_contact.DoNotPhone = value; }
        }

        public string Address2_PostalCode
        {
            get { return m_contact.Address2_PostalCode; }
            set { m_contact.Address2_PostalCode = value; }
        }


        public Money Aging30
        {
            get { return m_contact.Aging30; }
            set { m_contact.Aging30 = value; }
        }

        public Money Aging30_Base
        {
            get { return m_contact.Aging30_Base; }
            set { m_contact.Aging30_Base = value; }
        }

        public string Address1_UPSZone
        {
            get { return m_contact.Address1_UPSZone; }
            set { m_contact.Address1_UPSZone = value; }
        }

        public string Suffix
        {
            get { return m_contact.Suffix; }
            set { m_contact.Suffix = value; }
        }

        public string Salutation
        {
            get { return m_contact.Salutation; }
            set { m_contact.Salutation = value; }
        }

        public EntityReference ModifiedBy
        {
            get { return m_contact.ModifiedBy; }
            set { m_contact.ModifiedBy = value; }
        }

        public string GovernmentId
        {
            get { return m_contact.GovernmentId; }
            set { m_contact.GovernmentId = value; }
        }

        public string Address1_PrimaryContactName
        {
            get { return m_contact.Address1_PrimaryContactName; }
            set { m_contact.Address1_PrimaryContactName = value; }
        }

        public bool? DoNotSendMM
        {
            get { return m_contact.DoNotSendMM; }
            set { m_contact.DoNotSendMM = value; }
        }

        public string Address1_Country
        {
            get { return m_contact.Address1_Country; }
            set { m_contact.Address1_Country = value; }
        }

        public Money CreditLimit
        {
            get { return m_contact.CreditLimit; }
            set { m_contact.CreditLimit = value; }
        }

        public string LastName
        {
            get { return m_contact.LastName; }
            set { m_contact.LastName = value; }
        }

        public string FirstName
        {
            get { return m_contact.FirstName; }
            set { m_contact.FirstName = value; }
        }

        public string Address2_City
        {
            get { return m_contact.Address2_City; }
            set { m_contact.Address2_City = value; }
        }

        public string AssistantPhone
        {
            get { return m_contact.AssistantPhone; }
            set { m_contact.AssistantPhone = value; }
        }

        public bool? DoNotEMail
        {
            get { return m_contact.DoNotEMail; }
            set { m_contact.DoNotEMail = value; }
        }

        public double? Address2_Longitude
        {
            get { return m_contact.Address2_Longitude; }
            set { m_contact.Address2_Longitude = value; }
        }

        public string YomiFirstName
        {
            get { return m_contact.YomiFirstName; }
            set { m_contact.YomiFirstName = value; }
        }

        public string Telephone1
        {
            get { return m_contact.Telephone1; }
            set { m_contact.Telephone1 = value; }
        }

        public string Address1_Line1
        {
            get { return m_contact.Address1_Line1; }
            set { m_contact.Address1_Line1 = value; }
        }

        public string WebSiteUrl
        {
            get { return m_contact.WebSiteUrl; }
            set { m_contact.WebSiteUrl = value; }
        }

        public string Address2_County
        {
            get { return m_contact.Address2_County; }
            set { m_contact.Address2_County = value; }
        }

        public OptionSetValue ShippingMethodCode
        {
            get { return m_contact.ShippingMethodCode; }
            set { m_contact.ShippingMethodCode = value; }
        }

        public DateTime? Anniversary
        {
            get { return m_contact.Anniversary; }
            set { m_contact.Anniversary = value; }
        }

        public string Telephone2
        {
            get { return m_contact.Telephone2; }
            set { m_contact.Telephone2 = value; }
        }

        public EntityReference ParentContactId
        {
            get { return m_contact.ParentContactId; }
            set { m_contact.ParentContactId = value; }
        }

        public OptionSetValue HasChildrenCode
        {
            get { return m_contact.HasChildrenCode; }
            set { m_contact.HasChildrenCode = value; }
        }

        public string Address2_Fax
        {
            get { return m_contact.Address2_Fax; }
            set { m_contact.Address2_Fax = value; }
        }

        public DateTime? CreatedOn
        {
            get { return m_contact.CreatedOn; }
            set { m_contact.CreatedOn = value; }
        }

        public EntityReference AccountId
        {
            get { return m_contact.AccountId; }
            set { m_contact.AccountId = value; }
        }

        public string Address1_Line3
        {
            get { return m_contact.Address1_Line3; }
            set { m_contact.Address1_Line3 = value; }
        }

        public EntityReference DefaultPriceLevelId
        {
            get { return m_contact.DefaultPriceLevelId; }
            set { m_contact.DefaultPriceLevelId = value; }
        }

        public decimal? ExchangeRate
        {
            get { return m_contact.ExchangeRate; }
            set { m_contact.ExchangeRate = value; }
        }

        public string Address2_UPSZone
        {
            get { return m_contact.Address2_UPSZone; }
            set { m_contact.Address2_UPSZone = value; }
        }

        public string MiddleName
        {
            get { return m_contact.MiddleName; }
            set { m_contact.MiddleName = value; }
        }

        public string Address1_PostalCode
        {
            get { return m_contact.Address1_PostalCode; }
            set { m_contact.Address1_PostalCode = value; }
        }

        public bool? CreditOnHold
        {
            get { return m_contact.CreditOnHold; }
            set { m_contact.CreditOnHold = value; }
        }

       

        public override string ToString()
        {
            return string.Format("{0}: {1}", Id, FullName);
        }
    }
}